package com.runssnail.demo.spring.web.action;

import com.runssnail.demo.spring.config.ConfigManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by zhengwei on 2016/1/28.
 */
@Controller
public class IndexAction {

    private static final Logger logger = LoggerFactory.getLogger(IndexAction.class);

    @Autowired
    private ConfigManager configManager;

    @RequestMapping("index")
    public void index(HttpServletRequest request) {

        if (logger.isInfoEnabled()) {
            logger.info("index");
        }

        System.out.println(configManager.get("jdbc.class"));

        logger.error("test error");
    }
}
